public class Test3 {
    public static void main(String[] args) {
        int[] arr = {12,34,65,3,2,6,3,8,5,90};
        System.out.println(digit(arr));
    }
    public static int[] digit(int[] arr){
        StringBuilder sb = new StringBuilder();
        int[] returnArr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            sb.append(arr[i]);
        }
        for (int i = 0; i < sb.length(); i++) {
            ++returnArr[sb.charAt(i)-48];
        }
        return returnArr;
    }
}
